package com.cyj.user.service.impl;

import com.cyj.user.dao.UserMapper;
import com.cyj.user.entity.User;
import com.cyj.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;


    public int insertUser(User user) {
        return userMapper.insertUser(user);
    }


    public User selectUserById(Integer id) {
        return userMapper.selectUserById(id);
    }


    public List<User> selectAllUsers() {
        return userMapper.selectAllUsers();
    }


    public int updateUser(User user) {
        return userMapper.updateUser(user);
    }


    public int deleteUserById(Integer id) {
        return userMapper.deleteUserById(id);
    }

    public User selectUserByUsernameAndPassword(String username, String password) {

        return userMapper.selectUserByUsernameAndPassword(username, password);
    }
}